home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WOleInterfaceFamily -- Ole Interface Family class
- *
- *
- * Events:
- *
- * Create -- Create event
- *
- * Destroy -- Destroy event
- *
- * AboutToDestroy -- AboutToDestroy event
- *
- *
- *************************************************************************/
-
- #ifndef _WOLEIFAM_HPP_INCLUDED
- #define _WOLEIFAM_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WOLETYPE_HPP_INCLUDED
- # include "woletype.hpp"
- #endif
- #ifndef _WOLESOBJ_HPP_INCLUDED
- # include "wolesobj.hpp"
- #endif
-
- // forward class declarations
- class WCMCLASS wllist_header;
- class WCMCLASS WApplication;
-
- class WCMCLASS WOleInterfaceFamilyRegistryData {
- public:
- WOleInterfaceFamilyRegistryData( const WCLSID & clsid, void * );
- ~WOleInterfaceFamilyRegistryData( void );
-
- // Properties
- WBool SetRegistryDataBlock( void * );
- void *GetRegistryDataBlock( void ) const;
-
- // Self Registration
- virtual WBool Register( WApplication * );
- virtual WBool Unregister( WApplication * );
-
- WCLSID _classID;
- static WOleInterfaceFamilyRegistryData *Head;
- WOleInterfaceFamilyRegistryData *next;
-
- private:
- void *_registryDataBlock;
- };
-
- // the following is definitions of WOleInterfaceFamily
-
- class WCMCLASS WOleInterfaceFamily : public WEventGenerator {
- WDeclareSubclass( WOleInterfaceFamily, WEventGenerator );
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- // Aggregating IUnknown ( unkOuter )
- // This class will NOT call AddRef through the IUnknown
- // pointer nor will it call Release in its destructor.
- // This is to avoid circular reference counts as
- // The implementor on the aggregating IUnknown is expected
- // to control the lifetime of the instance of this class.
- WOleInterfaceFamily( WOleServerObject *serverObject );
-
- virtual ~WOleInterfaceFamily();
-
- public:
-
- /**************************************************************
- * Properties
- **************************************************************/
-
- // Class Name
- WString GetName( void ) const;
-
- /**************************************************************
- * Static Methods
- **************************************************************/
-
- // Self Registration
- static WBool Register( WApplication *application );
- static WBool Unregister( WApplication *application );
-
- /**************************************************************
- * Methods
- **************************************************************/
-
- // overrides
-
- virtual WBool Destroy( void );
-
- virtual WBool AboutToDestroy( void );
-
- // Query Interface
- // The object that owns the aggregating IUnknown pointer
- // ( usually a WOleServerObject ) will call this method
- // to retrieve pointers to interface implementations.
- // NOTE: DO NOT AddRef the returned "iface" this is done by the
- // server object
- virtual WBool QueryInterface( const WCLSID & clsid, void **iface );
-
- /**********************************************************
- * Data Members
- *********************************************************/
-
- protected:
- WOleServerObject *_serverObject;
- WPIUnknown _unkOuter;
- WString _name;
-
- };
-
- /*************************************************************************
- *
- * WOleGenericInterfaceFamily -- Generic Ole Interface Family class
- *
- *
- * Events:
- *
- *************************************************************************/
-
- class WCMCLASS WOleGenericInterfaceFamily : public WOleInterfaceFamily {
- WDeclareSubclass( WOleGenericInterfaceFamily, WOleInterfaceFamily );
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- // Aggregating IUnknown ( unkOuter )
- // This class will NOT call AddRef through the IUnknown
- // pointer nor will it call Release in its destructor.
- // This is to avoid circular reference counts as
- // The implementor on the aggregating IUnknown is expected
- // to control the lifetime of the instance of this class.
- WOleGenericInterfaceFamily( WOleServerObject *serverObject );
-
- virtual ~WOleGenericInterfaceFamily();
-
- public:
-
- /**************************************************************
- * Properties
- **************************************************************/
-
- /**************************************************************
- * Methods
- **************************************************************/
-
- virtual WBool QueryInterface( const WCLSID & clsid, void **iface );
-
- // Add
- WBool AddInterface( const WCLSID & wclsid, WPIUnknown pIUnknown );
-
- /**********************************************************
- * Data Members
- *********************************************************/
-
- protected:
- wllist_header *_interfaceList;
- };
-
- #define WOleDefineInterfaceFamily( c, c_id, rdb ) \
- static WOleInterfaceFamilyRegistryData _WOleIntFamRegistryData( c_id, (void*)&rdb );
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WOLEIFAM_HPP_INCLUDED
-
-